home *** CD-ROM | disk | FTP | other *** search
-
- /************************************************************
-
- Telephones.h
- C Interface to the Telephone Manager
-
-
- Copyright Apple Computer, Inc. 1990-1993
- All rights reserved
-
- ************************************************************/
-
-
- #ifndef __TELEPHONES__
- #define __TELEPHONES__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __EVENTS__
- #include <Events.h>
- #endif
-
- #ifndef __DIALOGS__
- #include <Dialogs.h>
- #endif
-
- #ifndef __CTBUTILITIES__
- #include <CTBUtilities.h>
- #endif
-
-
- #ifndef classTEL
- enum {
- classTEL = 'vbnd' /* telephone tool file type */
- };
- #endif
-
-
- enum {
-
- curTELVersion = 2, /* current Telephone Manager version */
-
- /* TELErr */
-
- telGenericError = -1,
- telNoErr = 0,
- telNoTools = 8, /* no telephone tools found in extension folder */
-
- telBadTermErr = (-10001), /* invalid TELHandle or handle not found*/
- telBadDNErr = (-10002), /* TELDNHandle not found or invalid */
- telBadCAErr = (-10003), /* TELCAHandle not found or invalid */
- telBadHandErr = (-10004), /* bad handle specified */
- telBadProcErr = (-10005), /* bad msgProc specified */
- telCAUnavail = (-10006), /* a CA is not available */
- telNoMemErr = (-10007), /* no memory to allocate handle */
- telNoOpenErr = (-10008), /* unable to open terminal */
-
- telBadHTypeErr = (-10010), /* bad hook type specified */
- telHTypeNotSupp = (-10011), /* hook type not supported by this tool */
- telBadLevelErr = (-10012), /* bad volume level setting */
- telBadVTypeErr = (-10013), /* bad volume type error */
- telVTypeNotSupp = (-10014), /* volume type not supported by this tool*/
- telBadAPattErr = (-10015), /* bad alerting pattern specified */
- telAPattNotSupp = (-10016), /* alerting pattern not supported by tool*/
- telBadIndex = (-10017), /* bad index specified */
- telIndexNotSupp = (-10018), /* index not supported by this tool */
- telBadStateErr = (-10019), /* bad device state specified */
- telStateNotSupp = (-10020), /* device state not supported by tool */
- telBadIntExt = (-10021), /* bad internal external error */
- telIntExtNotSupp = (-10022), /* internal external type not supported by this tool */
- telBadDNDType = (-10023), /* bad DND type specified */
- telDNDTypeNotSupp = (-10024), /* DND type is not supported by this tool */
-
- telFeatNotSub = (-10030), /* feature not subscribed */
- telFeatNotAvail = (-10031), /* feature subscribed but not available */
- telFeatActive = (-10032), /* feature already active */
- telFeatNotSupp = (-10033), /* feature program call not supported by this tool */
-
- telConfLimitErr = (-10040), /* limit specified is too high for this configuration */
- telConfNoLimit = (-10041), /* no limit was specified but required*/
- telConfErr = (-10042), /* conference was not prepared */
- telConfRej = (-10043), /* conference request was rejected */
- telTransferErr = (-10044), /* transfer not prepared */
- telTransferRej = (-10045), /* transfer request rejected */
- telCBErr = (-10046), /* call back feature not set previously */
- telConfLimitExceeded = (-10047), /* attempt to exceed switch conference limits */
-
- telBadDNType = (-10050), /* DN type invalid */
- telBadPageID = (-10051), /* bad page ID specified*/
- telBadIntercomID = (-10052), /* bad intercom ID specified */
- telBadFeatureID = (-10053), /* bad feature ID specified */
- telBadFwdType = (-10054), /* bad fwdType specified */
- telBadPickupGroupID = (-10055), /* bad pickup group ID specified */
- telBadParkID = (-10056), /* bad park id specified */
- telBadSelect = (-10057), /* unable to select or deselect DN */
- telBadBearerType = (-10058), /* bad bearerType specified */
- telBadRate = (-10059), /* bad rate specified */
- telDNTypeNotSupp = (-10060), /* DN type not supported by tool */
- telFwdTypeNotSupp = (-10061), /* forward type not supported by tool */
- telBadDisplayMode = (-10062), /* bad display mode specified */
- telDisplayModeNotSupp = (-10063), /* display mode not supported by tool */
- telNoCallbackRef = (-10064), /* no call back reference was specified, but is required */
-
- telAlreadyOpen = (-10070), /* terminal already open */
- telStillNeeded = (-10071), /* terminal driver still needed by someone else */
- telTermNotOpen = (-10072), /* terminal not opened via TELOpenTerm */
-
- telCANotAcceptable = (-10080), /* CA not "acceptable" */
- telCANotRejectable = (-10081), /* CA not "rejectable" */
- telCANotDeflectable = (-10082), /* CA not "deflectable" */
-
- telPBErr = (-10090), /* parameter block error, bad format */
- telBadFunction = (-10091), /* bad msgCode specified */
-
- /* telNoTools = (-10101), unable to find any telephone tools */
- telNoSuchTool = (-10102), /* unable to find tool with name specified */
- telUnknownErr = (-10103), /* unable to set config */
- telNoCommFolder = (-10106), /* Communications/Extensions ƒ not found */
- telInitFailed = (-10107), /* initialization failed */
-
- telChooseDisaster = chooseDisaster,
- telChooseFailed = chooseFailed,
- telChooseAborted = chooseAborted,
- telChooseOKMinor = chooseOKMinor,
- telChooseOKMajor = chooseOKMajor,
- telChooseCancel = chooseCancel,
-
- telChooseOKTermChanged = 4
-
- };
-
-
- enum {
-
- /* PHYSICAL TERMINAL CONSTANTS */
-
- /*HOOK STATE CONSTANTS */
- telHandset = 1, /* handset hookswitch */
- telSpeakerphone = 2, /* speakerphone 'on' switch */
-
- telDeviceOnHook = 0, /* device on hook */
- telDeviceOffHook = 1, /* device off hook */
-
- /* VOLUME CONTROL CONSTANTS */
- telHandsetSpeakerVol = 1, /* volume of the handset speaker */
- telHandsetMicVol = 2, /* sensitivity of the handset mic */
- telSpeakerphoneVol = 3, /* speakerphone volume */
- telSpeakerphoneMicVol = 4, /* sensitivity of the spkrphone mic */
- telRingerVol = 5, /* volume of the ringer */
-
- telVolSame = 0, /* leaves the volume at previous level */
- telVolMin = 1, /* turns volume down to minimum level, but not off */
- telVolMax = 100, /* highest level allowed by the Telephone Manager */
-
- telVolStateSame = 0, /* leaves device in same state */
- telVolStateOff = 1, /* turns the device off , */
- /* but doesn't change the volume setting. */
- /* Use for mute functions. */
- telVolStateOn = 2, /* turns the device on. Volume setting is */
- /* the same as previously set.*/
-
- /* DISPLAY CONSTANTS */
- telNormalDisplayMode = 1, /* normal display mode */
- telInspectMode = 2, /* inspect display mode */
- telMiscMode = 3, /* miscellaneous display mode */
- telRetrieveMode = 4, /* message retrieval mode */
- telDirectoryQueryMode = 5, /* electronic directory mode */
-
- telEntireDisplay = 0, /* entire Display */
-
- /* KEY PRESS CONSTANTS */
- telHangupKey = 1, /* drop, or release, key pressed */
- telHoldKey = 2, /* hold key pressed */
- telConferenceKey = 3, /* conference key pressed */
- telTransferKey = 4, /* transfer key pressed */
- telForwardKey = 5, /* call forward key pressed */
- telCallbackKey = 6, /* call back key pressed */
- telDNDKey = 7, /* do not disturb key pressed */
- telCallPickupKey = 8, /* call Pickup key pressed */
- telCallParkKey = 9, /* call Park key pressed */
- telCallDeflectKey = 10, /* call Deflect key pressed */
- telVoiceMailAccessKey = 11, /* voice Mail Access key pressed */
- telCallRejectKey = 12, /* call Reject key pressed */
- telOtherKey = 16, /* other key pressed */
-
-
- telKeyPadPress = 1, /* key pressed on 12 digit keypad*/
- telFeatureKeyPress = 2, /* feature Key Pressed */
-
- telTerminalEnabled = 0,
- telTerminalDisabled = 1,
-
- /* ALERT PATTERN */
-
- telPattern0 = 0,
- telPattern1 = 1,
- telPattern2 = 2,
- telPattern3 = 3,
- telPattern4 = 4,
- telPattern5 = 5,
- telPattern6 = 6,
- telPattern7 = 7,
- telPatternOff = 8,
- telPatternUndefined = 15,
-
- /* DN TYPES */
-
- telAllDNs = 0, /* counts all types of DNs */
- telInternalDNs = 1, /* connected to PBX or other non-public switch */
- telInternalDNsOnly = 2, /* connected to PBX or other non-public switch */
- /* and able to place internal calls only */
- telExternalDNs = 3, /* connected to public network */
- telDNTypeUnknown = 4, /* DN type unknown */
-
- /* CALL FORWARDING TYPES */
-
- telForwardImmediate = 1, /* immediately forward calls */
- telForwardBusy = 2, /* forward on Busy */
- telForwardNoAnswer = 3, /* forward on No answer */
- telForwardBusyNA = 4, /* forwarding for busy and no answer*/
- telForwardTypeUnknown = 5, /* type of forwarding is unknown */
-
- /* CALL FORWARDING MESSAGES */
-
- telForwardCleared = 0, /* forwarding has been cleared */
- telForwardEst = 1, /* forwarding has been established*/
- telForwardFailed = 2, /* attempt to setup forwarding has failed*/
-
- /* DO NOT DISTURB TYPES */
-
- telDNDIntExt = 0, /* do not disturb for all internal and external calls*/
- telDNDExternal = 1, /* do not disturb for external calls only */
- telDNDInternal = 2, /* do not disturb for internal calls only */
- telDNDNonIntercom = 3, /* do not disturb for all calls except intercom */
-
- /* DO NOT DISTURB MESSAGES */
-
- telDNDCleared = 0, /* do not disturb has been cleared */
- telDNDEst = 1, /* do not disturb has been established */
- telDNDFailed = 2, /* attempt to setup do not disturb has failed */
-
- /* VOICE MAIL MESSAGES */
-
- telAllVoiceMessagesRead = 0,/* all messages have been read, none are waiting */
- /* to be read */
- telNewVoiceMessage = 1, /* a new message has arrived or messages are waiting */
- /* for this DN */
-
- /* DNSELECT MESSAGE */
- telDNDeselected = 0, /* DN has been deselected */
- telDNSelected = 1, /* DN has been selected */
-
- /* CALL ORIGINATORS */
- telInternalCall = 0, /* return nth internal CA */
- telExternalCall = 1, /* return nth external CA */
- telUnknownCallOrigin = 2, /* unknown call type */
- telAllCallOrigins = 2, /* return nth CA internal or external */
-
- /* CALL TYPES */
-
- telVoiceMailAccessOut = (-7),
- telPageOut = (-6),
- telIntercomOut = (-5),
- telCallbackOut = (-4),
- telPickup = (-3),
- telParkRetrieve = (-2),
- telNormalOut = (-1),
- telUnknownCallType = 0,
- telNormalIn = 1,
- telForwardedImmediate = 2,
- telForwardedBusy = 3,
- telForwardedNoAnswer= 4,
- telTransfer = 5,
- telDeflected = 6,
- telIntercepted = 7,
- telDeflectRecall = 8,
- telParkRecall = 9,
- telTransferredRecall= 10,
- telIntercomIn = 11,
- telCallbackIn = 12,
-
- /* DIAL TYPES */
-
- telDNDialable = 0, /* this DN could be dialed via TELSetupCall */
- telDNNorthAmerican = 1, /* rmtDN is standard North America 10 digit number */
- telDNInternational = 2, /* rmtDN is an international number */
- telDNAlmostDialable = 3, /* rmtDN is almost dialable, */
- /* missing prefix such as 9 or 1 */
- telDNUnknown = 15, /* unknown whether DN is dialable */
-
- /* CALL PROGRESS MESSAGES */
-
- telCAPDialTone = 1, /* dial tone */
- telCAPRinging = 2, /* destination CA is alerting */
- telCAPDialing = 3, /* dialing the other end */
- telCAPReorder = 4, /* reorder */
- telCAPBusy = 5, /* busy */
- telCAPRouted = 6, /* call routed; rmtDN will hold the routing directory */
- /* number routeDN and routePartyName have been updated */
- telCAPRoutedOff = 7, /* call routed off-network; no further progress will */
- /* be available */
- telCAPTimeout = 8, /* call timed out */
- telCAPUpdate = 9, /* name and rmtDN information has been updated */
- telCAPPrompt = 10, /* the network is prompting for more information */
- telCAPWaiting = 11, /* call is proceeding, but there is no response yet */
- /* from the destination */
- telCAPUnknown = 15, /* call progress state unknown */
-
- /* OUTGOING CALL MESSAGES */
-
- telPhysical = 0, /* user lifted handset and initiated call */
- telProgrammatic = 1, /* programmatic initiation of outgoing call */
-
- /* DISCONNECT MESSAGES */
-
- telLocalDisconnect = 0, /* local party, this user, responsible for disconnect */
- telRemoteDisconnect = 1, /* remote party responsible for disconnect */
-
- /* DISCONNECT TYPES */
-
- telCADNormal = 1, /* normal disconnect */
- telCADBusy = 2, /* remote user busy */
- telCADNoResponse = 3, /* remote not responding */
- telCADRejected = 4, /* call rejected */
- telCADNumberChanged = 5, /* number changed */
- telCADInvalidDest = 6, /* invalid destination address */
- telCADFacilityRejected = 7, /* requested facility rejected */
- telCADUnobtainableDest = 9, /* destination not obtainable */
- telCADCongested = 10, /* network congestion */
- telCADIncompatibleDest = 11,/* incompatible destination */
- telCADTimeout = 12, /* call timed out */
- telCADUnknown = 15, /* reason unknown */
-
- /* CONFERENCE MESSAGES */
-
- telConferencePrepFailed = 0, /* conference could not be prepared */
- telConferencePending = 1, /* conference prepared successfully */
- telConferenceEstFailed = 2, /* conference could not be established */
- telConferenceEst = 3, /* conference established */
-
- /* TRANSFER MESSAGES */
-
- telTransferPrepFailed = 0, /* transfer could not be prepared */
- telTransferPending = 1, /* transfer prepared successfully */
- telTransferEst = 2, /* consult or blind xfer successful */
- telTransferFailed = 3, /* consult or blind xfer failed */
- telTransferred = 4, /* message to originator of CA specifying */
- /* that call was transferred to rmtDN */
-
- /* HOLD MESSAGES */
-
- telHoldCleared = 0,
- telHoldEst = 1,
- telHoldFailed = 2,
-
- /* RECEIVE DIGIT MESSAGES */
-
- telDigitAudible = 0,
- telDigitNotAudible = 1,
-
- /* CALL PARK MESSAGES */
-
- telCallParkEst = 1, /* call has been successfully parked */
- telCallParkRetrieveEst = 2, /* parked Call has been successfully retrieved */
- telCallParkFailed = 3, /* attempt to setup call park has failed */
- telCallParkRetrieveFailed = 4, /* attempt to retrieve parked call failed */
- telCallParkRecall = 5, /* call park has been recalled */
-
- /* CALL BACK MESSAGES */
-
- telCallbackCleared = 0, /* call back has been cleared */
- telCallbackEst = 1, /* call back has been established */
- telCallbackNowAvail = 2, /* call can be called back with TELCallBackNow */
- /* if CA is zero, else call IS calling back on CA */
- telCallbackFailed = 3, /* attempt to setup callback has failed */
- telCallbackDesired = 4, /* a user has called this terminal, received no */
- /* answer and desires this terminal to call it */
- /* back */
- telCallbackDesiredCleared = 5, /* call back for no answer no longer desired */
- telCalledback = 6, /* callback has occurred successfully */
-
- /* CALL REJECT MESSAGES */
-
- telCallRejectFailed = 0, /* attempt to reject call has failed */
- telCallRejectEst = 1, /* call successfully rejected */
- telCallRejected = 2, /* message to originator that call was rejected */
-
- /* CALL DEFLECT MESSAGES */
-
- telCallDeflectFailed = 0, /* attempt to deflect call has failed */
- telCallDeflectEst = 1, /* call successfully deflected */
- telCallDeflectRecall = 2, /* deflected call has been recalled */
- telCallDeflected = 3, /* message to originator that call was deflected */
- /* to rmtDN */
- telAutoDeflectImmediate = 4, /* a call was automatically deflected from this */
- /* terminal as a result of immediate call */
- /* forwarding */
- telAutoDeflectBusy = 5, /* a call was automatically deflected from this */
- /* terminal as a result of call forwarding on busy */
- telAutoDeflectNoAnswer = 6, /* a call was automatically deflected from this */
- /* terminal as a result of call forwarding on */
- /* no answer */
-
- /* CONFERENCE SPLIT MESSAGES */
-
- telConferenceSplitFailed = 0, /* CA could not be split */
- telConferenceSplitEst = 1, /* CA split successfully */
-
- /* CONFERENCE DROP MESSAGES */
-
- telConferenceDropFailed = 0, /* CA could not be dropped */
- telConferenceDropped = 1, /* CA dropped successfully */
-
- /* CALL PICKUP MESSAGES */
-
- telCallPickupEst = 0, /* call pickup was successful */
- telCallPickupFailed = 1, /* call pickup failed */
- telCallPickedUp = 2, /* message to originator that call was picked */
- /* up at a different DN */
-
- /* PAGING MESSAGES */
-
- telPageEst = 0, /* paging was successful */
- telPageComplete = 1, /* paging activity completed */
- telPageFailed = 2, /* paging failed */
-
- /* INTERCOM MESSAGES */
-
- telIntercomEst = 0, /* intercom was successful */
- telIntercomComplete = 1, /* intercom activity completed */
- telIntercomFailed = 2, /* intercom failed */
-
- /* MODEM TONE MESSAGES */
-
- telModemToneDetected = 0, /* modem tone was detected */
- telModemToneCleared = 1, /* modem tone went away */
-
- /* FAX TONE MESSAGES */
-
- telFaxToneDetected = 0, /* fax tone was detected */
- telFaxToneCleared = 1, /* fax tone went away */
-
- /* IN USE MESSAGES */
-
- telInUsePrivate = 0, /* MADN is in use and can't be accessed */
- telInUseCanAccess = 1, /* MADN is in use, and others can access it */
- /* and join in */
- telInUseCanMakePrivate = 2, /* MADN is in use, but available for any one */
- /* person to access */
- telInUseCleared = 3, /* MADN is no longer in use */
-
- /* CALL APPEARANCE STATES */
-
- telCAIdleState = 0, /* a call doesn't exist at this time */
- telCAInUseState = 1, /* the call is active but at another terminal */
- telCAOfferState = 2, /* a call is being offered to the terminal */
- telCAQueuedState = 3, /* a call is being queued at this terminal */
- telCAAlertingState = 4, /* a call is alerting at the terminal */
- telCADialToneState = 5, /* initiated outgoing call has dialtone */
- telCADialingState = 6, /* initiated outgoing call is dialing */
- telCAWaitingState = 7, /* initiated outgoing call is waiting for */
- /* response from destination */
- telCARingingState = 8, /* the outgoing call is ringing. */
- telCABusyState = 9, /* destination is busy or can't be reached */
- telCAHeldState = 10, /* call has been put on hold by this terminal */
- telCAConferencedState = 11, /* this CA is part of a conference now */
- telCAActiveState = 12, /* the call is active and parties are free */
- /* to exchange data */
- telCAReorderState = 13, /* CA is in a reorder state */
- telCAConferencedHeldState = 14, /* CA is a conference call in a held state */
- telCAUnknownState = 15, /* the call state is unknown */
-
- /* TERMINAL MESSAGE EVENTMASKS */
-
- telTermHookMsg = 0x00000001, /* the hookswitch state has changed */
- telTermKeyMsg = 0x00000002, /* a phone pad key has been depressed */
- telTermVolMsg = 0x00000004, /* volume setting has changed */
- telTermDisplayMsg = 0x00000008, /* display has changed */
- telTermEnableMsg = 0x00000010, /* terminal has become enabled */
- telTermOpenMsg = 0x00000020, /* terminal has been opened */
- telTermCloseMsg = 0x00000040, /* terminal is shutting down */
- telTermResetMsg = 0x00000080, /* terminal has been reset */
- telTermErrorMsg = 0x00000100, /* hard equipment error */
- telTermOtherMsg = 0x80000000, /* vendor defined error */
- telAllTermMsgs = 0x000001ff, /* mask to all non tool specific terminal events */
-
- /* DN MESSAGE EVENTMASK CONSTANTS */
- telDNForwardMsg = 0x00000001, /* forward feature activity */
- telDNDNDMsg = 0x00000002, /* do not disturb feature activity */
- telDNVoiceMailMsg = 0x00000004, /* message has arrived for this DN */
- telDNSelectedMsg = 0x00000008, /* DN has been selected or deselected */
- telDNOtherMsg = 0x80000000, /* a custom message for use by tools */
- telAllDNMsgs = 0x0000000f, /* mask to all non tool specific dn events */
-
- /* CA MESSAGE EVENTMASK CONSTANTS */
- telCAAlertingMsg = 0x00000001, /* CA is alerting */
- telCAOfferMsg = 0x00000002, /* CA is being offered a call */
- telCAProgressMsg = 0x00000004, /* call progress info for this CA */
- telCAOutgoingMsg = 0x00000008, /* CA is initiating an outgoing call */
- telCADisconnectMsg = 0x00000010, /* CA disconnected (dropped or rmt disc */
- telCAActiveMsg = 0x00000020, /* CA is active and voice/data is free */
- /* to flow end to end */
- telCAConferenceMsg = 0x00000040, /* conference activity on CA */
- telCATransferMsg = 0x00000080, /* transfer feature activity */
- telCAHoldMsg = 0x00000100, /* hold feature activity */
- telCADigitsMsg = 0x00000200, /* remote signaling digits arrived */
- telCACallParkMsg = 0x00000400, /* CA call park feature activity */
- telCACallbackMsg = 0x00000800, /* CA call back feature activity */
- telCARejectMsg = 0x00001000, /* CA is rejected */
- telCADeflectMsg = 0x00002000, /* CA is deflected */
- telCAForwardMsg = 0x00004000, /* CA is forwarded to this DN */
- telCAConferenceSplitMsg = 0x00008000, /* conference split activity */
- telCAConferenceDropMsg = 0x00010000, /* conference drop activity */
- telCAQueuedMsg = 0x00020000, /* CA has been queued */
- telCAInUseMsg = 0x00040000, /* CA is in use */
- telCACallPickupMsg = 0x00080000, /* CA pickup activity */
- telCAPagingMsg = 0x00100000, /* CA paging activity */
- telCAIntercomMsg = 0x00200000, /* CA intercom activity */
- telCAModemToneMsg = 0x00400000, /* modem tones detected */
- telCAFaxToneMsg = 0x00800000, /* fax tones detected */
- telCAIdleMsg = 0x01000000, /* CA is in idle state */
- telCASuccessiveAlertMsg = 0x02000000, /* phone is alerting, one per ring */
- telCAUserUserInfoMsg = 0x04000000, /* user to user information has arrrived */
- /* for this CA */
- telCAOtherMsg = 0x80000000, /* tool specific CA message */
- telAllCAMsgs = 0x07ffffff /* mask to all non tool specific CA events */
-
- };
-
- typedef OSErr TELErr;
-
- typedef unsigned long TELFlags;
-
- enum {
- telNoMenus = 1 << 16, /* tells tool not to display any custom menus */
- telQuiet = 1 << 17 /* tells tool not to display any dialog boxes or alerts */
- };
-
- typedef unsigned long TELFeatureFlags;
-
- enum {
- pcmAvail = 1 << 0, /* true if PCM voice data accessible */
- hasHandset = 1 << 1, /* true if a phone handset is attached */
- hasSpeakerphone = 1 << 2, /* true if a 2 way speakerphone is attached */
- canOnHookDial = 1 << 3, /* can on-hook dial */
- hasRinger = 1 << 4, /* terminal has its own ringer */
- canSetDisplay = 1 << 5, /* application can write to the display */
- hasKeypad = 1 << 6, /* attached phone has standard 12 key pad */
- hasVideo = 1 << 7, /* terminal has a videophone */
- hasOther = 1 << 8, /* reserved for future use */
- crossDNConference = 1 << 9, /* can perform cross-DN conferences */
- hasSubaddress = 1 << 10, /* attached network supports subaddressing */
- hasUserUserInfo = 1 << 11 /* network supports user-to-user info */
- /* other bits in FeatureFlags are reserved by Apple for future use */
- };
-
-
- struct TELTermRecord {
-
- short tRef;
- TELFeatureFlags featureFlags;
- short handsetSpeakerVol;
- short handsetMicVol;
- short speakerphoneVol;
- short speakerphoneMicVol;
- short ringerVol;
- short otherVol;
- short ringerTypes;
- short hasDisplay;
- short displayRows;
- short numDNs;
- short maxAllocCA;
- short curAllocCA;
- long reserved;
- };
-
- typedef struct TELTermRecord TELTermRecord;
- typedef TELTermRecord *TELTermPtr;
-
-
- struct TELRecord {
- short procID;
-
- TELFlags flags;
- short reserved;
-
- long refCon;
- long userData;
-
- ProcPtr defproc;
-
- Ptr config;
- Ptr oldConfig;
-
- TELTermPtr pTELTerm;
-
- long telPrivate;
- long reserved1;
- long reserved2;
-
- long pTELTermSize;
- short version;
-
- };
-
- typedef struct TELRecord TELRecord;
- typedef TELRecord *TELPtr, **TELHandle;
-
-
- typedef unsigned long TELDNFeatureFlags;
-
- enum {
- dndSub = 1 << 0, /* do not disturb subscribed */
- dndAvail = 1 << 1, /* do not disturb available */
- dndActive = 1 << 2, /* do not disturb active */
-
- voiceMailAccessSub = 1 << 3, /* message waiting subscribed */
- voiceMailAccessAvail = 1 << 4, /* message waiting available */
- voiceMailAccessActive = 1 << 5, /* message waiting active */
-
- pagingSub = 1 << 6, /* paging is subscribed */
- pagingAvail = 1 << 7, /* paging is available */
- pagingActive = 1 << 8, /* paging is active */
-
- intercomSub = 1 << 9, /* intercom is subscribed */
- intercomAvail = 1 << 10, /* intercom is available */
- intercomActive = 1 << 11, /* intercom is active */
-
- dnSelectSub = 1 << 12, /* DN select is subscribed */
- dnSelectAvail = 1 << 13, /* DN select is available */
- dnSelectActive = 1 << 14, /* DN is selected */
-
- callPickupSub = 1 << 15, /* call pickup is subscribed */
- callPickupAvail = 1 << 16, /* call pickup is available */
-
- dnInUse = 1 << 17, /* a CA is allocated for this DN */
- logicalDN = 1 << 18, /* this DN is not on this terminal */
- dnAccessible = 1 << 19, /* commands can be sent to this DN */
- canInitiate = 1 << 20, /* an outgoing CA can be initiated */
- voiceMessageWaiting = 1 << 21 /* voice mail waiting for this dn */
- /* other bits in FeatureFlags are reserved by Apple for future use */
- };
-
-
- typedef unsigned long TELDNForwardFlags;
-
- enum {
- immediateForwardSub = 1 << 0, /* immediate call forward subscribed */
- immediateForwardAvail = 1 << 1, /* immediate call forward available */
- immediateForwardActive = 1 << 2, /* immediate call forward active */
-
- busyForwardSub = 1 << 3, /* forward on busy subscribed */
- busyForwardAvail = 1 << 4, /* forward on busy available */
- busyForwardActive = 1 << 5, /* forward on busy active */
-
- noAnswerForwardSub = 1 << 6, /* no answer call forward subscribed */
- noAnswerForwardAvail = 1 << 7, /* no answer call forward available */
- noAnswerForwardActive = 1 << 8, /* no answer call forward active */
-
- busyNAForwardSub = 1 << 9, /* busy & no answer call forward subscribed */
- busyNAForwardAvail = 1 << 10, /* busy & no answer call forward available */
- busyNAForwardActive = 1 << 11 /* busy & no answer call forward active */
- /* other bits in FwdFlags are reserved by Apple for future use */
- };
-
-
- struct TELDNRecord {
-
- short dnRef;
- StringPtr dn;
- StringPtr dnPartyName;
- StringPtr dnSubaddress;
- TELHandle hTEL;
- short maxAllocCA;
- short curAllocCA;
- short dnType;
- TELDNFeatureFlags featureFlags;
- short numPageIDs;
- short numIntercomIDs;
- short numPickupIDs;
- TELDNForwardFlags forwardFlags;
- StringPtr iForwardDN;
- StringPtr iForwardSubaddress;
- StringPtr iForwardPartyName;
- StringPtr bForwardDN;
- StringPtr bForwardSubaddress;
- StringPtr bForwardPartyName;
- StringPtr naForwardDN;
- StringPtr naForwardSubaddress;
- StringPtr naForwardPartyName;
- short naForwardRings;
- long telDNPrivate;
- long refCon;
- long userData;
- long reserved;
- };
-
- typedef struct TELDNRecord TELDNRecord;
- typedef TELDNRecord *TELDNPtr, **TELDNHandle;
-
-
- typedef unsigned long TELCAFeatureFlags;
- enum {
- holdSub = 1 << 0, /* hold subscribed */
- holdAvail = 1 << 1, /* hold available */
- holdActive = 1 << 2, /* hold active */
-
- conferenceSub = 1 << 3, /* conference subscribed */
- conferenceAvail = 1 << 4, /* conference available */
- conferenceActive = 1 << 5, /* conference active */
-
- conferenceDropSub = 1 << 6, /* conference drop subscribed */
- conferenceDropAvail = 1 << 7, /* a call to TELDrop will drop this */
- /* CA only from a conference */
-
- conferenceSplitSub = 1 << 8, /* conference split subscribed */
- conferenceSplitAvail = 1 << 9, /* conference split available for this CA */
- numToConferenceRequired = 1 << 10, /* the number of CAs to be conferenced is */
- /* required in TELConfPrep */
-
- transferSub = 1 << 11, /* transfer subscribed */
- transferAvail = 1 << 12, /* transfer available */
- transferActive = 1 << 13, /* transfer active */
-
- caRelated = 1 << 14 /* this CA is the specified in some */
- /* other CA's relatedCA field */
- /* other bits in FeaturesFlag are reserved by Apple for future use */
- };
-
- typedef unsigned long TELCAOtherFeatures;
- enum {
- callbackSub = 1 << 0, /* call back subscribed */
- callbackAvail = 1 << 1, /* call back available */
- callbackActive = 1 << 2, /* call back active */
- callbackClearSub = 1 << 3, /* call back clearing subscribed */
-
- callbackNowSub = 1 << 4, /* call back now subscribed */
- callbackNowAvail = 1 << 5, /* call back now available */
-
- callbackBusy = 1 << 6, /* call back on busy */
- callbackNoAnswer = 1 << 7, /* call back on no answer */
- callbackReturnsRef = 1 << 8, /* call back returns a reference */
-
- parkSub = 1 << 9, /* call park subscribed */
- parkAvail = 1 << 10, /* call park available */
- parkActive = 1 << 11, /* call park active */
- parkRetrieveSub = 1 << 12, /* call park retrieve subscribed */
- parkRetrieveWithID = 1 << 13, /* retrieve parked calls with IDs */
- parkWithReturnedID = 1 << 14, /* park call to a specific remote ID */
- parkWithGivenID = 1 << 18, /* for switch that requires ID for parking */
-
- rejectable = 1 << 15, /* CA is rejectable */
- deflectable = 1 << 16, /* CA is deflectable */
- acceptable = 1 << 17 /* CA is acceptable */
- /* other bits in TELCAOtherFeatures are reserved by Apple for future use */
- };
-
-
- struct TELCARecord {
- short caRef;
- TELDNHandle hTELDN;
- TELHandle hTEL;
- short caState;
- struct TELCARecord **relatedCA;
- long connectTime; /* can be used by application to keep track of connect time */
- short intExt;
- short callType;
- short dialType;
- short bearerType;
- short rate;
- StringPtr rmtDN;
- StringPtr rmtPartyName;
- StringPtr rmtSubaddress;
- StringPtr routeDN;
- StringPtr routePartyName;
- StringPtr routeSubaddress;
- short priority;
- short conferenceLimit;
- TELCAFeatureFlags featureFlags;
- TELCAOtherFeatures otherFeatures;
- long telCAPrivate;
- long refCon;
- long userData;
- long reserved;
- };
-
- typedef struct TELCARecord TELCARecord;
- typedef TELCARecord *TELCAPtr, **TELCAHandle;
-
-
- /* Constants for HandleType in structure above */
- enum {
- telHandleType = 0, /* feature requires a terminal handle */
- telDNHandleType = 1, /* feature requires a DN handle */
- telCAHandleType = 2 /* feature requires a CA handle */
- };
-
- struct FeatureList {
- short featureID;
- StringPtr featureName;
- short handleType;
- struct FeatureList *nextFeature;
- };
-
- typedef struct FeatureList FeatureList;
- typedef FeatureList *FeatureListPtr;
-
- /* CA MESSAGE STRUCTURES FOR MSGINFO */
-
- struct CAGenericMsgRec {
- StringPtr rmtDN;
- StringPtr rmtName;
- StringPtr rmtSubaddress;
- short dialType;
- };
- typedef struct CAGenericMsgRec CAGenericMsgRec;
-
- struct CAUserUserInfoMsgRec {
- StringPtr userUserInfo;
- };
-
- typedef struct CAUserUserInfoMsgRec CAUserUserInfoMsgRec;
-
- struct CAConfMsgRec {
- TELCAHandle relatedCA;
- };
- typedef struct CAConfMsgRec CAConfMsgRec;
-
-
- struct CATransfMsgRec {
- StringPtr rmtDN;
- StringPtr rmtName;
- StringPtr rmtSubaddress;
- short dialType;
- TELCAHandle prepCA;
- };
- typedef struct CATransfMsgRec CATransfMsgRec;
-
-
-
- typedef pascal void (*TELTermMsgProcPtr)(TELHandle hTEL, long msg, short mtype,
- short value, long globals);
-
- typedef pascal void (*TELDNMsgProcPtr)(TELDNHandle hTELDN, long Msg, short mtype,
- short value, ConstStr255Param rmtDN, ConstStr255Param rmtName,
- ConstStr255Param rmtSubaddress, long globals);
-
- typedef pascal void (*TELCAMsgProcPtr)(TELCAHandle hTELCA, long Msg, short mtype,
- short value, Ptr Msginfo, long globals);
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- pascal TELErr InitTEL();
-
- pascal TELErr TELGetInfo(TELHandle hTEL);
- pascal TELErr TELOpenTerm(TELHandle hTEL);
- pascal TELErr TELResetTerm(TELHandle hTEL);
- pascal TELErr TELCloseTerm(TELHandle hTEL);
-
- pascal TELErr TELTermMsgHand(TELHandle hTEL, long eventMask,
- TELTermMsgProcPtr msgProc, long globals);
- pascal TELErr TELClrTermMsgHand(TELHandle hTEL, TELTermMsgProcPtr msgProc);
- pascal TELErr TELTermEventsSupp(TELHandle hTEL, long *eventMask) ;
-
- pascal short TELGetProcID(Str255 name);
- pascal TELHandle TELNew(short procID, TELFlags flags, long refCon, long userData);
- pascal TELErr TELDefault(Ptr *theConfig, short procID, Boolean allocate);
- pascal Boolean TELValidate(TELHandle hTEL);
- pascal Ptr TELGetConfig(TELHandle hTEL);
- pascal short TELSetConfig(TELHandle hTEL, Ptr thePtr);
- pascal TELErr TELChoose(TELHandle *hTEL, Point where, ProcPtr idleProc);
-
- pascal Handle TELSetupPreflight(short procID, long *magicCookie);
- pascal void TELSetupSetup(short procID, Ptr theConfig, short count,
- DialogPtr theDialog, long *magicCookie);
- pascal Boolean TELSetupFilter(short procID, Ptr theConfig, short count,
- DialogPtr theDialog, EventRecord *theEvent, short *theItem,
- long *magicCookie);
- pascal void TELSetupItem(short procID, Ptr theConfig, short count,
- DialogPtr theDialog, short *theItem, long *magicCookie);
- pascal void TELSetupCleanup(short procID, Ptr theConfig, short count,
- DialogPtr theDialog, long *magicCookie);
- pascal void TELSetupXCleanup(short procID, Ptr theConfig, short count,
- DialogPtr theDialog, Boolean OKed, long *magicCookie);
- pascal void TELSetupPostflight(short procID);
-
- pascal TELErr TELDispose(TELHandle hTEL);
-
- pascal short TELCountDNs(TELHandle hTEL, short dnType, Boolean physical);
- pascal TELErr TELDNLookupByIndex( TELHandle hTEL, short dnType, Boolean physical,
- short index, TELDNHandle *hTELDN);
- pascal TELErr TELDNLookupByName(TELHandle hTEL, ConstStr255Param DN,
- TELDNHandle *hTELDN);
- pascal TELErr TELDNSelect(TELDNHandle hTELDN, Boolean select);
- pascal TELErr TELDNDispose(TELDNHandle hTELDN);
- pascal TELErr TELGetDNInfo(TELDNHandle hTELDN);
- pascal TELErr TELGetDNFlags(TELDNHandle hTELDN, long *dnFeatureFlags,
- long *dnForwardFlags);
-
- pascal TELErr TELDNMsgHand ( TELDNHandle hTELDN, Boolean allDNs, long eventMask,
- TELDNMsgProcPtr msgProc, long globals);
- pascal TELErr TELClrDNMsgHand(TELDNHandle hTELDN, TELDNMsgProcPtr msgProc);
- pascal TELErr TELDNEventsSupp(TELDNHandle hTELDN, long *eventMask);
-
- pascal short TELCountCAs(TELDNHandle hTELDN, short internalExternal);
- pascal TELErr TELCALookup(TELDNHandle hTELDN, short internalExternal,
- short index, TELCAHandle *hTELCA);
- pascal TELErr TELCADispose(TELCAHandle hTELCA);
- pascal TELErr TELGetCAState(TELCAHandle hTELCA, short *state);
- pascal TELErr TELGetCAFlags(TELCAHandle hTELCA, long *caFeatureFlags,
- long *caOtherFeatures);
- pascal TELErr TELGetCAInfo(TELCAHandle hTELCA);
-
- pascal TELErr TELCAMsgHand(TELDNHandle hTELDN, long eventMask,
- TELCAMsgProcPtr msgProc, long globals);
- pascal TELErr TELClrCAMsgHand(TELDNHandle hTELDN, TELCAMsgProcPtr msgProc);
- pascal TELErr TELCAEventsSupp(TELDNHandle hTELDN, long *eventMask);
-
- pascal TELErr TELSetupCall(TELDNHandle hTELDN, TELCAHandle *hTELCA,
- ConstStr255Param destDN, ConstStr255Param destName,
- ConstStr255Param destSubaddress, ConstStr255Param userUserInfo,
- short bearerType, short rate);
- pascal TELErr TELConnect(TELCAHandle hTELCA);
- pascal TELErr TELDialDigits(TELCAHandle hTELCA, ConstStr255Param digits);
-
- pascal TELErr TELAcceptCall(TELCAHandle hTELCA);
- pascal TELErr TELRejectCall(TELCAHandle hTELCA, short reason);
- pascal TELErr TELDeflectCall(TELCAHandle hTELCA, ConstStr255Param rmtDN,
- ConstStr255Param rmtName, ConstStr255Param rmtSubaddress);
- pascal TELErr TELAnswerCall(TELCAHandle hTELCA);
- pascal TELErr TELDrop(TELCAHandle hTELCA, ConstStr255Param userUserInfo);
-
- pascal TELErr TELHold(TELCAHandle hTELCA);
- pascal TELErr TELRetrieve(TELCAHandle hTELCA);
-
- pascal TELErr TELConferencePrep(TELCAHandle hTELCA1, TELCAHandle hTELCA2,
- short numToConference);
- pascal TELErr TELConferenceEstablish(TELCAHandle hTELCA1, TELCAHandle hTELCA2);
- pascal TELErr TELConferenceSplit(TELCAHandle hTELCA);
-
- pascal TELErr TELTransferPrep(TELCAHandle hTELCA1, TELCAHandle hTELCA2);
- pascal TELErr TELTransferEstablish(TELCAHandle hTELCA1,TELCAHandle hTELCA2);
- pascal TELErr TELTransferBlind(TELCAHandle hTELCA, ConstStr255Param rmtDN,
- ConstStr255Param rmtName, ConstStr255Param rmtSubaddress);
-
- pascal TELErr TELForwardSet(TELDNHandle hTELDN, ConstStr255Param forwardDN,
- ConstStr255Param forwardName, ConstStr255Param forwardSubaddress,
- short forwardType, short numrings);
- pascal TELErr TELForwardClear(TELDNHandle hTELDN, short forwardType);
-
- pascal TELErr TELCallbackSet(TELCAHandle hTELCA, short *callbackRef);
- pascal TELErr TELCallbackClear(TELHandle hTEL, short callbackRef);
- pascal TELErr TELCallbackNow(TELCAHandle hTELCA, short callbackRef);
-
- pascal TELErr TELDNDSet(TELDNHandle hTELDN, short dndType);
- pascal TELErr TELDNDClear(TELDNHandle hTELDN, short dndType);
-
- pascal TELErr TELCallPickup(TELCAHandle hTELCA, ConstStr255Param pickupDN,
- short pickupGroupID);
-
- pascal TELErr TELParkCall(TELCAHandle hTELCA, StringPtr *parkRetrieveID,
- ConstStr255Param parkID);
- pascal TELErr TELRetrieveParkedCall(TELCAHandle hTELCA,
- ConstStr255Param parkRetrieveID);
-
- pascal TELErr TELVoiceMailAccess(TELCAHandle hTELCA);
- pascal TELErr TELPaging(TELCAHandle hTELCA, short pageID);
- pascal TELErr TELIntercom(TELCAHandle hTELCA, short intercomID);
-
- pascal TELErr TELOtherFeatureList(TELHandle hTEL, FeatureListPtr *fList);
- pascal TELErr TELOtherFeatureImplement(TELHandle hTEL, Handle theHandle,
- short featureID);
- pascal TELErr TELToolFunctions(TELHandle hTEL, short msgcode,
- Boolean *supportsIt);
- pascal TELErr TELOtherFunction(TELHandle hTEL, Ptr paramblock, long size);
-
- pascal TELErr TELGetHooksw(TELHandle hTEL, short hookType, Boolean *onHook );
- pascal TELErr TELSetHooksw(TELHandle hTEL, short hookType, Boolean onHook );
- pascal TELErr TELGetVolume(TELHandle hTEL, short volType, short *level,
- short *volState);
- pascal TELErr TELSetVolume(TELHandle hTEL, short volType, short *level,
- short volState);
- pascal TELErr TELAlert(TELHandle hTEL, short *level, short alertPattern);
- pascal TELErr TELGetDisplay(TELHandle hTEL, short index, short *displayMode,
- StringPtr *text);
- pascal TELErr TELSetDisplay(TELHandle hTEL, short index, short displayMode,
- ConstStr255Param text);
-
- pascal void TELIdle(TELHandle hTEL);
- pascal void TELActivate(TELHandle hTEL, Boolean activate);
- pascal void TELResume(TELHandle hTEL, Boolean resume);
- pascal Boolean TELMenu(TELHandle hTEL, short menuID, short item);
- pascal void TELEvent(TELHandle hTEL, const EventRecord *theEvent);
- pascal void TELGetToolName(short procID, Str255 name);
- pascal Handle TELGetVersion(TELHandle hTEL);
- pascal short TELGetTELVersion();
-
- pascal TELErr TELIntlToEnglish(TELHandle hTEL, Ptr inputPtr,
- Ptr *outputPtr, short language);
- pascal TELErr TELEnglishToIntl(TELHandle hTEL, Ptr inputPtr,
- Ptr *outputPtr, short language);
-
-
- #ifdef __cplusplus
- }
- #endif
-
-
- #endif __TELEPHONES__
-